<?php 
if(isset($_GET['ref'])){
	header('Location: http://www.w3ca.com.br/portal/emag?chk=true&url=' . $_SERVER['HTTP_REFERER']);
}else{
	header('Location: http://www.w3ca.com.br/portal/emag');
}
?>